<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <title>我的兑换</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/index.css">
	<script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/public.js"></script>
</head>

<body style="background: #f7f7f7;">
	<div class="order">
		<div class="no-order">
			<img src="image/cry.png">
			<p>您还没有兑换的订单~</p>
		</div>
	</div>
    
</body>
<script>
	var url = 'http://ysapi.jin315.com/',
		str = '',
		userid = getQueryString('userid'); //获取userid
	$.ajax({
		type:"GET",
		url:url+'getGoodsOrderList.ashx',
		dataType:"jsonp",
		data:{userID:'userid'},
		jsonp: "jsonpCallback",
		jsonpCallback: "jsonpCallback",
		success:function(data){
			if(data && data.code == 200 && data.data.goodsDetail.length > 0){
				$('.no-order').css('display','none');
				var data = data.data.goodsDetail;
				for(var i = 0;i<data.length;i++){
					str +='<div class="order-list">'+
							'<h3 class="order-number">订单号：<span>'+data[i].OrderID+'</span></h3>'+
							'<div class="order-wrap">'+
								'<div class="order-pic">'+
									'<img src='+data[i].HeaderPic+' alt='+data[i].GoodTitle+'>'+
								'</div>'+
								'<div class="order-body">'+
									'<h3 class="order-title">'+data[i].GoodTitle+'</h3>'+
									'<p class="order-y">成交价（云钻数）</p>'+
									'<p class="order-num">'+
										'<span class="total">'+data[i].PriceYunZuan+'</span>'+
										'<span class="pcs fr">x1</span>'+
									'</p>'+
								'</div>'+
							'</div>'+
							'<h4 class="order-timer">下单时间：<span class="timers">'+data[i].CreatedDateTime+'</span> <span class="state fr">';
							
					if(data[i].Status == 'WC'){
						str +='等待处理'
					}else if(data[i].Status == 'SU'){
						str +='订单完成'
					}
					str +='</span></h4>'+
					'</div>';
					
				}
				$('.order').append(str);
			}
		}
	})
</script>
</html>
